package com.qqt.csr.order.enums;

import lombok.Getter;

@Getter
public enum WorkOrderEventEnum {

    CREATED("CREATED", "创建事件"),
    CREATED_ALLOCATED("CREATED_ALLOCATED", "创建+直接分配事件"),
    RECEIVED("RECEIVED", "认领事件"),
    ALLOCATED("ALLOCATED", "分配事件"),
    EDIT_ALLOCATED("EDIT_ALLOCATED", "编辑+直接分配事件"),
    SUSPENDED("SUSPENDED", "挂起事件"),
    RECOVERED("RECOVERED", "恢复事件"),
    REOPENED("REOPENED", "重开事件"),
    COMPLETED("COMPLETED", "完成事件"),
    UPDATED_DESIGNEE("UPDATED_DESIGNEE", "变更处理人事件"),
    EDITED("EDITED", "编辑工单事件"),
    DELETED("DELETED", "删除工单事件"),
    ;

    private String code;
    private String desc;

    WorkOrderEventEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static WorkOrderEventEnum getByCode(String code) {
        for (WorkOrderEventEnum workOrderEventEnum : WorkOrderEventEnum.values()) {
            if (workOrderEventEnum.getCode().equals(code)) {
                return workOrderEventEnum;
            }
        }
        return null;
    }
}
